package org.zebias.springcloudeurekaclient.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.zebias.springcloudeurekaclient.entity.Customer;

/**
 * FeginClient[指定服务名字]
 */
@FeignClient(value = "SEARCH", fallbackFactory = SearchClientFallBackFactory.class)
public interface SearchClient {

    @RequestMapping(value = "/search", method = RequestMethod.GET)
    String search();

    @RequestMapping(value = "/search/{id}", method = RequestMethod.GET)
    Customer findById(@PathVariable("id") Integer id);

    @RequestMapping(value = "/getCustomer", method = RequestMethod.GET)
    Customer getCustomer(@RequestParam("id") Integer id, @RequestParam("name") String name);

    @RequestMapping(value = "/save", method = RequestMethod.GET)
    Customer save(@RequestBody Customer customer);
}
